﻿Imports DevExpress.LookAndFeel
Imports DevExpress.XtraBars.Docking2010.Views.MetroUI

Public Class frmMain
    'Public Sub New()

    '    ' This call is required by the designer.
    '    InitializeComponent()

    '    ' Add any initialization after the InitializeComponent() call.

    'End Sub
    Public Sub MetroUIView1_QueryControl(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs) Handles MetroUIView1.QueryControl

        Select Case e.Document.ControlName
            Case "ucQLBanHang"
                e.Control = New ucQLBanHang
            Case "ucQLDSPhuTung"
                e.Control = New ucQLDSPhuTung
            Case "ucQLHoaDon"
                e.Control = New ucQLHoaDon
            Case "ucQLKhachHang"
                e.Control = New ucQLKhachHang
            Case "ucQLNhapHang"
                e.Control = New ucQLNhapHang
            Case "ucThongKeDoanThuLoiNhuan"
                e.Control = New ucThongKeDoanThuLoiNhuan
            Case "ucThongKeKhachHang"
                e.Control = New ucThongKeKhachHang
            Case "ucThongTinBanQuyen"
                e.Control = New ucThongTinBanQuyen
            Case "ucSaoLuuPhucHoi"
                e.Control = New ucSaoLuuPhucHoi
            Case "ucQLPhieuNhap"
                e.Control = New ucQLPhieuNhap
            Case "ucQLKhac"
                e.Control = New ucQLKhac
            Case Else

        End Select


    End Sub



    Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim ThuNho As DelegateAction = New DelegateAction(AddressOf KiemTraDieuKien, AddressOf ThuNhoManHinh)
        ThuNho.Caption = "Thu nhỏ"
        ThuNho.Type = ActionType.Navigation
        ThuNho.Edge = ActionEdge.Right
        ThuNho.Behavior = ActionBehavior.HideBarOnClick
        MetroUIView1.ContentContainerActions.Add(ThuNho)
    End Sub

    Private Function KiemTraDieuKien() As Boolean
        Return True
    End Function
    Private Sub ThuNhoManHinh()
        Me.WindowState = FormWindowState.Minimized
    End Sub
End Class